package com.example.dynamic.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestService {
    @Autowired
    private Dynamic01Service dynamic01Service;
    @Autowired
    private Dynamic02Service dynamic02Service;


    public List<String> findAllUser() {
        return dynamic01Service.findAllUser();
    }

    public List<String> findAllCompany() {
        return dynamic02Service.findAllCompany();
    }

    public List<String> findAllCompanyByDs() {
        return dynamic02Service.findAllCompanyByDs();
    }

    @DS("dynamic-02")
    public List<String> findAllUserDs() {
        return dynamic01Service.findAllUserDs();
    }

    @DS("dynamic-01")
    public List<String> findAllCompanyByDs2() {
        return dynamic02Service.findAllCompanyByDs();

    }
}
